<template>
	<view >
		
	
	<view class="detbankcard_">
	 <view class="item_">
		<text>持卡人姓名：</text>
		<text>{{bankdetobj.payeeName}}</text>
	 </view>
	 
	 <view class="item_">
	 		<text>银行卡开户行：</text>
	 		<text>{{bankdetobj.bankName}}</text>
	 </view>
	 <view class="item_">
	 		<text>开户支行：</text>
	 		<text>{{bankdetobj.bankBranchName}}</text>
	 </view>
	 <view class="item_">
	 		<text>银行卡号：</text>
	 		<text>{{bankdetobj.bankCardNo}}</text>
	 </view>
	</view>
	
	<view class="submit_wrapper">
	    <view @click="submit">删除</view>
	  </view>
	</view>
	</view>
</template>
<!-- bankdet -->
<script>
	import {
		delbankcard,} from "@/api/bankcard";
	
	const app = getApp();
	export default {
	  name: "index.vue",
	  // 必须要在onReady生命周期，因为onLoad生命周期组件可能尚未创建完毕
	  onLoad(options) {
		  console.log(options)
	  	console.log(JSON.parse(options.bankdet))
		this.bankdetobj=JSON.parse(options.bankdet)
		
	  },
	  onReady() {
	  },
	  data() {
	    return {
	     bankdetobj:{}
	    };
	  },
	  methods: {
		  submit(){
			  const than = this;
			  console.log(this.bankdetobj.id)
			 
					  
			  wx.showModal({
			    title: "温馨提示",
			    content: `是否确定删除该银行卡？`,
			    confirmColor: "red", //确定文字的颜色
			    async success(res) {
			      if (res.confirm) {
					  
					  
			        const resData = await delbankcard({id:than.bankdetobj.id});
			        if (resData.code === 0) {
			          uni.navigateBack({
			                      //关闭当前页面，返回上一页面或多级页面。
			                      delta:1
			                  });

			        } else {
			         
			        }
			      } else if (res.cancel) {
			        console.log("用户点击取消");
			      }
			    },
			  });
		  }
		  
		 
		
	 
	  },
	};
</script>

<style lang="scss">
	.detbankcard_{
		width: rpx(351);
		height: auto;
		background: #FFFFFF;
		border-radius: 5px 5px 5px 5px;
		opacity: 1;
		box-sizing: border-box;
		padding: 0 rpx(12);
		margin: rpx(12) auto 0;
		>.item_{
			width: 100%;
			height: rpx(50);
			border-radius: 0px 0px 0px 0px;
			opacity: 1;
			display: flex;
			justify-content: space-between;
			border-bottom: rpx(1) solid #FAFAFA;
			align-items: center;
		}
		>.item_:last-child{
			border-bottom: none;
		}
		
		
	}
	.submit_wrapper{
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: rpx(8) rpx(12) rpx(8);
    z-index: 99;
    > view {
      background: #fa5151;
      border-radius: rpx(22);
      width: rpx(351);
      height: rpx(44);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: rpx(17);
      font-weight: 400;
      color: #ffffff;
    }
  }
</style>